package com.ypf.survey.customconverter;

import java.util.Collection;

import org.dozer.DozerConverter;

@SuppressWarnings("rawtypes")
public class CollectionConverter extends DozerConverter<Collection, Integer>{

	public CollectionConverter() {
		super(Collection.class, Integer.class);
	}

	@Override
	public Collection convertFrom(Integer source, Collection target) {
		throw new IllegalStateException("Unknown value!");
	}

	@Override
	public Integer convertTo(Collection source, Integer target) {
		return source != null ? source.size() : 0;
	}

}
